<?php


namespace App\Resource\Lottery3\Draw;


use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request)
    {
        $count = $this->count;
        $price = $this->gift->price ?? 0;
        return [
            'id' => $this->gift->id ?? null,
            'name' => $this->gift->name ?? null,
            'image' => $this->gift->picture ?? null,
            'price' => $price,
            'count' => $count,
            'total_price' =>$price * $count,
        ];
    }
}
